<?php
$medalID = 0;
?>
<input type="button" class="btnPrint" value="Print" onclick="javascript:window.print();" />
<div style="text-align: center">
    <h2>របាយការណ៍នៃការចែកចាយមេដាយ</h2>
    <h3><?php echo $filter ?></h3>
</div>
<div style="height: 10px"></div>
<div>
    <table class="table" border="1" cellpadding="0" cellspacing="0">
        <tr>
            <td rowspan="2" class="left top bottom" style="border-right: 1px solid black;"><?php echo "<img align='absmiddle' src='" . $root . "public/images/pdf/no.png'  />"; ?></td>
            <td rowspan="2"  class="left top bottom"><?php echo "<img align='absmiddle' src='" . $root . "public/images/pdf/type.png'  />"; ?></td>
            <td colspan="5" class="left top bottom"><?php echo "<img align='absmiddle' src='" . $root . "public/images/pdf/qty.png'  />"; ?></td>
            <td colspan="3" class="left top bottom"><?php echo "<img align='absmiddle' src='" . $root . "public/images/pdf/box.png'  />"; ?></td>
            <td rowspan="2" class="left right top bottom"><?php echo "<img align='absmiddle' src='" . $root . "public/images/pdf/niyabat.png'  />"; ?></td>
        </tr>
        <tr>
            <td class="left bottom"><?php echo "<img align='absmiddle' src='" . $root . "public/images/pdf/mhasereyvot.png'  />"; ?></td>
            <td class="left bottom"><?php echo "<img align='absmiddle' src='" . $root . "public/images/pdf/mhasena.png'  />"; ?></td>
            <td class="left bottom"><?php echo "<img align='absmiddle' src='" . $root . "public/images/pdf/thipadin.png'  />"; ?></td>
            <td class="left bottom"><?php echo "<img align='absmiddle' src='" . $root . "public/images/pdf/sena.png'  />"; ?></td>
            <td class="left bottom"><?php echo "<img align='absmiddle' src='" . $root . "public/images/pdf/asharith.png'  />"; ?></td>
            <td class="left bottom"><?php echo "<img align='absmiddle' src='" . $root . "public/images/pdf/big.png'  />"; ?></td>
            <td class="left bottom"><?php echo "<img align='absmiddle' src='" . $root . "public/images/pdf/medium.png'  />"; ?></td>
            <td class="left bottom"><?php echo "<img align='absmiddle' src='" . $root . "public/images/pdf/small.png'  />"; ?></td>
        </tr>
        <tr>
            <td class="left bottom no"><?php echo "១"; ?></td>
            <td class="left bottom type"><?php echo "<img align='absmiddle' src='" . $root . "public/images/pdf/cambodia.png'  />"; ?></td>
            <td class="left bottom"><?php echo number_format($medal[0]['amount']); ?></td>
            <td class="left bottom"><?php
echo number_format($medal[$medalID++]['amount']);
;
?></td>
            <td class="left bottom"><?php
                echo number_format($medal[$medalID++]['amount']);
                ;
?></td>
            <td class="left bottom"><?php
                echo number_format($medal[$medalID++]['amount']);
                ;
?></td>
            <td class="left bottom"><?php
                echo number_format($medal[$medalID++]['amount']);
                ;
?></td>
            <td class="left bottom size"><?php echo ""; ?></td>
            <td class="left bottom size"><?php echo ""; ?></td>
            <td class="left bottom size"><?php echo ""; ?></td>
            <td class="left bottom right"><?php echo ""; ?></td>
        </tr>
        <tr>
            <td class="left bottom no"><?php echo "២"; ?></td>
            <td class="left bottom type"><?php echo "<img align='absmiddle' src='" . $root . "public/images/pdf/queen.png'  />"; ?></td>
            <td class="left bottom"><?php echo number_format($medal[$medalID++]['amount']); ?></td>
            <td class="left bottom"><?php
                echo number_format($medal[$medalID++]['amount']);
                ;
?></td>
            <td class="left bottom"><?php
                echo number_format($medal[$medalID++]['amount']);
                ;
?></td>
            <td class="left bottom"><?php
                echo number_format($medal[$medalID++]['amount']);
                ;
?></td>
            <td class="left bottom"><?php
                echo number_format($medal[$medalID++]['amount']);
                ;
?></td>
            <td class="left bottom size"><?php echo ""; ?></td>
            <td class="left bottom size"><?php echo ""; ?></td>
            <td class="left bottom size"><?php echo ""; ?></td>
            <td class="left bottom right"><?php echo ""; ?></td>
        </tr>
        <tr>
            <td class="left bottom no"><?php echo "៣"; ?></td>
            <td class="left bottom type"><?php echo "<img align='absmiddle' src='" . $root . "public/images/pdf/sovanthara.png'  />"; ?></td>
            <td class="left bottom"><?php echo number_format($medal[$medalID++]['amount']); ?></td>
            <td class="left bottom"><?php
                echo number_format($medal[$medalID++]['amount']);
                ;
?></td>
            <td class="left bottom"><?php
                echo number_format($medal[$medalID++]['amount']);
                ;
?></td>
            <td class="left bottom"><?php
                echo number_format($medal[$medalID++]['amount']);
                ;
?></td>
            <td class="left bottom"><?php
                echo number_format($medal[$medalID++]['amount']);
                ;
?></td>
            <td class="left bottom size"><?php echo ""; ?></td>
            <td class="left bottom size"><?php echo ""; ?></td>
            <td class="left bottom size"><?php echo ""; ?></td>
            <td class="left bottom right"><?php echo ""; ?></td>
        </tr>
        <tr>
            <td class="left bottom no"><?php echo "៤"; ?></td>
            <td class="left bottom type"><?php echo "<img align='absmiddle' src='" . $root . "public/images/pdf/munisaraphon.png'  />"; ?></td>
            <td class="left bottom"><?php echo number_format($medal[$medalID++]['amount']); ?></td>
            <td class="left bottom"><?php
                echo number_format($medal[$medalID++]['amount']);
                ;
?></td>
            <td class="left bottom"><?php
                echo number_format($medal[$medalID++]['amount']);
                ;
?></td>
            <td class="left bottom"><?php
                echo number_format($medal[$medalID++]['amount']);
                ;
?></td>
            <td class="left bottom"><?php
                echo number_format($medal[$medalID++]['amount']);
                ;
?></td>
            <td class="left bottom size"><?php echo ""; ?></td>
            <td class="left bottom size"><?php echo ""; ?></td>
            <td class="left bottom size"><?php echo ""; ?></td>
            <td class="left bottom right"><?php echo ""; ?></td>
        </tr>
        <tr>
            <td class="left bottom no"><?php echo "៥"; ?></td>
            <td class="left bottom type"><?php echo "<img align='absmiddle' src='" . $root . "public/images/pdf/sahametrey.png'  />"; ?></td>
            <td class="left bottom"><?php echo number_format($medal[$medalID++]['amount']); ?></td>
            <td class="left bottom"><?php
                echo number_format($medal[$medalID++]['amount']);
                ;
?></td>
            <td class="left bottom"><?php
                echo number_format($medal[$medalID++]['amount']);
                ;
?></td>
            <td class="left bottom"><?php
                echo number_format($medal[$medalID++]['amount']);
                ;
?></td>
            <td class="left bottom"><?php
                echo number_format($medal[$medalID++]['amount']);
                ;
?></td>
            <td class="left bottom size"><?php echo ""; ?></td>
            <td class="left bottom size"><?php echo ""; ?></td>
            <td class="left bottom size"><?php echo ""; ?></td>
            <td class="left bottom right"><?php echo ""; ?></td>
        </tr>
    </table>
</div>
<div style="height: 10px"></div>
<div>    
    <div><?php echo "<img align='absmiddle' src='" . $root . "public/images/pdf/medal3level.png'  />"; ?></div>
</div>
<div style="height: 10px"></div>
<div>
    <table class="table" border="1" cellpadding="0" cellspacing="0">
        <tr>
            <td rowspan="2" class="left top bottom"><?php echo "<img align='absmiddle' src='" . $root . "public/images/pdf/no.png'  />"; ?></td>
            <td rowspan="2"  class="left top bottom"><?php echo "<img align='absmiddle' src='" . $root . "public/images/pdf/type.png'  />"; ?></td>
            <td colspan="3" class="left top bottom"><?php echo "<img align='absmiddle' src='" . $root . "public/images/pdf/qty.png'  />"; ?></td>
            <td rowspan="2" class="left top bottom"><?php echo "<img align='absmiddle' src='" . $root . "public/images/pdf/box.png'  />"; ?></td>
            <td rowspan="2" class="left right top bottom"><?php echo "<img align='absmiddle' src='" . $root . "public/images/pdf/niyabat.png'  />"; ?></td>
        </tr>
        <tr>
            <td class="left bottom"><?php echo "<img align='absmiddle' src='" . $root . "public/images/pdf/gold.png'  />"; ?></td>
            <td class="left bottom"><?php echo "<img align='absmiddle' src='" . $root . "public/images/pdf/silver.png'  />"; ?></td>
            <td class="left bottom"><?php echo "<img align='absmiddle' src='" . $root . "public/images/pdf/platium.png'  />"; ?></td>
        </tr>   
        <tr>
            <td class="left bottom no"><?php echo "១"; ?></td>
            <td class="left bottom type"><?php echo "<img align='absmiddle' src='" . $root . "public/images/pdf/protect.png'  />"; ?></td>
            <td class="left bottom"><?php echo number_format($medal[$medalID++]['amount']); ?></td>
            <td class="left bottom"><?php
                echo number_format($medal[$medalID++]['amount']);
                ;
?></td>
            <td class="left bottom"><?php
                echo number_format($medal[$medalID++]['amount']);
                ;
?></td>
            <td class="left bottom"><?php echo ""; ?></td>
            <td class="left bottom right"><?php echo ""; ?></td>
        </tr>
        <tr>
            <td class="left bottom no"><?php echo "២"; ?></td>
            <td class="left bottom type"><?php echo "<img align='absmiddle' src='" . $root . "public/images/pdf/job.png'  />"; ?></td>
            <td class="left bottom"><?php echo number_format($medal[$medalID++]['amount']); ?></td>
            <td class="left bottom"><?php
                echo number_format($medal[$medalID++]['amount']);
                ;
?></td>
            <td class="left bottom"><?php
                echo number_format($medal[$medalID++]['amount']);
                ;
?></td>
            <td class="left bottom"><?php echo ""; ?></td>
            <td class="left bottom right"><?php echo ""; ?></td>
        </tr>
        <tr>
            <td class="left bottom no"><?php echo "៣"; ?></td>
            <td class="left bottom type"><?php echo "<img align='absmiddle' src='" . $root . "public/images/pdf/build.png'  />"; ?></td>
            <td class="left bottom"><?php echo number_format($medal[$medalID++]['amount']); ?></td>
            <td class="left bottom"><?php
                echo number_format($medal[$medalID++]['amount']);
                ;
?></td>
            <td class="left bottom"><?php
                echo number_format($medal[$medalID++]['amount']);
                ;
?></td>
            <td class="left bottom"><?php echo ""; ?></td>
            <td class="left bottom right"><?php echo ""; ?></td>
        </tr>
        <tr>
            <td class="left bottom no"><?php echo "៤"; ?></td>
            <td class="left bottom type"><?php echo "<img align='absmiddle' src='" . $root . "public/images/pdf/woman.png'  />"; ?></td>
            <td class="left bottom"><?php echo number_format($medal[$medalID++]['amount']); ?></td>
            <td class="left bottom"><?php
                echo number_format($medal[$medalID++]['amount']);
                ;
?></td>
            <td class="left bottom"><?php
                echo number_format($medal[$medalID++]['amount']);
                ;
?></td>
            <td class="left bottom"><?php echo ""; ?></td>
            <td class="left bottom right"><?php echo ""; ?></td>
        </tr>
        <tr>
            <td class="left bottom no"><?php echo "៥"; ?></td>
            <td class="left bottom type"><?php echo "<img align='absmiddle' src='" . $root . "public/images/pdf/khmersport.png'  />"; ?></td>
            <td class="left bottom"><?php echo number_format($medal[$medalID++]['amount']); ?></td>
            <td class="left bottom"><?php
                echo number_format($medal[$medalID++]['amount']);
                ;
?></td>
            <td class="left bottom"><?php
                echo number_format($medal[$medalID++]['amount']);
                ;
?></td>
            <td class="left bottom"><?php echo ""; ?></td>
            <td class="left bottom right"><?php echo ""; ?></td>
        </tr>
    </table>
</div>
<div style="height: 10px"></div>
<div>    
    <div><?php echo "<img align='absmiddle' src='" . $root . "public/images/pdf/medal1level.png'  />"; ?></div>
</div>
<div style="height: 10px"></div>
<div>
    <table class="table" border="1" cellpadding="0" cellspacing="0">
        <tr>
            <td class="left top bottom"><?php echo "<img align='absmiddle' src='" . $root . "public/images/pdf/no.png'  />"; ?></td>
            <td  class="left top bottom"><?php echo "<img align='absmiddle' src='" . $root . "public/images/pdf/type.png'  />"; ?></td>
            <td class="left top bottom"><?php echo "<img align='absmiddle' src='" . $root . "public/images/pdf/qty.png'  />"; ?></td>
            <td class="left top bottom"><?php echo "<img align='absmiddle' src='" . $root . "public/images/pdf/box.png'  />"; ?></td>
            <td class="left right top bottom"><?php echo "<img align='absmiddle' src='" . $root . "public/images/pdf/niyabat.png'  />"; ?></td>
        </tr>
        <tr>
            <td class="left bottom no"><?php echo "១"; ?></td>
            <td class="left bottom type"><?php echo "<img align='absmiddle' src='" . $root . "public/images/pdf/cheatobkar.png'  />"; ?></td>
            <td class="left bottom"><?php echo number_format($medal[$medalID++]['amount']); ?></td>
            <td class="left bottom"><?php echo ""; ?></td>
            <td class="left bottom right"><?php echo ""; ?></td>
        </tr>
        <tr>
            <td class="left bottom no"><?php echo "២"; ?></td>
            <td class="left bottom type"><?php echo "<img align='absmiddle' src='" . $root . "public/images/pdf/independent.png'  />"; ?></td>
            <td class="left bottom"><?php echo number_format($medal[$medalID++]['amount']); ?></td>
            <td class="left bottom"><?php echo ""; ?></td>
            <td class="left bottom right"><?php echo ""; ?></td>
        </tr>
        <tr>
            <td class="left bottom no"><?php echo "៣"; ?></td>
            <td class="left bottom type"><?php echo "<img align='absmiddle' src='" . $root . "public/images/pdf/senacheysith.png'  />"; ?></td>
            <td class="left bottom"><?php echo number_format($medal[$medalID++]['amount']); ?></td>
            <td class="left bottom"><?php echo ""; ?></td>
            <td class="left bottom right"><?php echo ""; ?></td>
        </tr>
    </table>
</div>
<div style="height: 10px"></div>
